package com.spring.learn.aop;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.math.BigDecimal;

public class AspectTest {


    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");

        ProductService productService= (ProductService) ctx.getBean("productServiceImpl");



        Product product = new Product();
        product.setId("123");
        product.setName("test name");
        product.setPrice(new BigDecimal("12.56"));

        productService.addProduct(product);

        System.out.println("---------------");

        productService.getProductByID("123");

    }
}
